#include "member.h"

using namespace std;

int Member::rentCost = 500;
int Member::delayCost = 100;
int Member::rentTime = 1;

ifstream& operator>>(ifstream& f, Member& df){
    string tmp;

    getline(f, tmp);
    getline(f, df.name);
    getline(f, df.address);
    f >> df.id;
    getline(f, tmp);
    getline(f, df.availability);
    f >> df.balance;
    getline(f, tmp);

    return f;
}

stringstream& operator>>(stringstream& s, Member& df) {
    string tmp;

    getline(s, df.name);
    getline(s, df.address);
    s >> df.id;
    getline(s, tmp);
    getline(s, df.availability);
    s >> df.balance;
    getline(s, tmp);

    return s;
}

bool operator==(const Member& a, const Member& b) {
    return a.id == b.id;
}

bool operator>(const Member& a, const Member& b) {
    return a.name > b.name;
}

bool operator<(const Member& a, const Member& b) {
    return a.name < b.name;
}

